package myky.com.doctorapp.presenter

import io.reactivex.disposables.Disposable
import myky.com.doctorapp.base.BasePresenterIm
import myky.com.doctorapp.base.RxSubscribe
import myky.com.doctorapp.contract.LongRangeListFragmentContract
import myky.com.doctorapp.entity.LongRangeListEntity
import myky.com.doctorapp.model.LongRangeListFragmentModel


/**
 * Description:
 *
 * @author wuyangwuyang
 * Created by 2019/3/8 on 11:13
 */
class LongRangeListFragmentPresenter:BasePresenterIm<LongRangeListFragmentContract.View>(),LongRangeListFragmentContract.Presenter{


    var longRangeListFragmentModel:LongRangeListFragmentModel= LongRangeListFragmentModel()
    override fun premoteList(total: String,statusId:String) {
        longRangeListFragmentModel.remoteLists(total,statusId).subscribe(object : RxSubscribe<LongRangeListEntity.PayLoadBean>(){
            override fun onSuccess(t: LongRangeListEntity.PayLoadBean) {
                mView.showContentView()
                mView.showDataSuccess(t)
            }

            override fun onFailed(code: Int, msg: String?) {
                mView.showNetErrorView()
            }

            override fun onSubscribe(d: Disposable) {
                addSubscription(d)
            }


        })
    }


}
